<template>
  <div class="joblist">
    <div class="job_each"  @click="gotoDetail(item.id)" v-for="item in jobList.rows" :key="item.id" :v-if="item.professionName">
<div class="job_header">
  <div class="job_name">
    <span>{{item.name}}</span>
  </div>
  <div class="job_address">
    <span>
        {{item.address}}
    </span>
  </div>
</div>
<div class="job_middle">
  <span class="job_salary">
    {{item.salary}}元
  </span>
  <span class="job_sort">
   ·{{item.professionName}}
  </span>

</div>
<div class="job_footer">
  <div class="job_left">
    <span class="contact">{{item.contacts}}</span>
    <span class="company">{{item.companyName}}</span>
  </div>
  <div class="job_view">
    查看
  </div>
</div>
    
    </div>
  </div>
</template>

<script>
import { jobList } from "@/service/job/jobservice"
export default {
  data() {
    return {
      jobList: []
    }
  },
  async created() {
    let { data } = await jobList()
    this.jobList = data
    console.log(JSON.parse(JSON.stringify(data.rows)));
  },
  methods:{
    gotoDetail(id) {
            this.$router.push("/jobdetail/" + id)
          
        },
  }
}
</script>

<style lang="scss" scoped>
.joblist {
  // background: rgb(210, 210, 210);

  width: 100%;
  margin-top: 5px;
  padding-bottom: 50px;
  .job_each {
    margin-bottom: 5px;
    border-radius: 5px;
    background-color: #fff;
    div{
      margin-bottom: 5px;
    }
    width: 100%;
    // height: 100px;
// background-color: rgb(97, 201, 205);
padding: 10px;
.job_header{

  display: flex;
  justify-content: space-between;
  .job_name{
    span{
       font-size: 16px;
    font-weight: 700;
    }
   
  }
  .job_address{
    color: grey;
  }
}
.job_middle{
  .job_salary{
    
      color:rgb(255,85,46)
 
  }
  .job_sort{
    color: #aaa;
  }
}
.job_footer{
  display: flex;
  justify-content: space-between;
  align-items: center;
  .job_left{
    display: flex;
    flex-direction: column;
    justify-content: center;
    .contact{
      
        font-size: 15px;
      
      
    }
    .company{
    
         color: rgb(93, 90, 90);
     
     
    }
  }
  .job_view{
    width: 60px;
    height: 30px;
    background-color: rgb(255,85,46);
    text-align: center;
    line-height: 30px;
    // font-size: 16px;
    color: aliceblue;
    border-radius: 5px;

  }
}
  }
}
</style>